<?php

/**
 * index.php
 */
defined('YII_DEBUG') or define('YII_DEBUG', TRUE);
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);

// On dev display all errors
if (YII_DEBUG) {
    error_reporting(-1);
    ini_set('display_errors', true);
}

//date_default_timezone_set('UTC');
//chdir(dirname(__FILE__).'/../..');
//constant and define
$define = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'common' . DIRECTORY_SEPARATOR . 'define.php';

require_once($define);

date_default_timezone_set(APP_TIMEZONE);

$common = ROOT . '/common';
require_once($common . '/lib/Yii/yii.php');
//require_once($common.'/components/WebApplication.php');
require_once($common . '/lib/global.php');

$config = require(ROOT . '/backend/protected/config/main.php');


$app = Yii::createApplication('CWebApplication', $config);

$app->run();

/* uncomment if you wish to debug your resulting config */
/* echo '<pre>' . dump($config) . '</pre>'; */